import React from 'react';
import {render} from 'react-dom';
import 'babel-polyfill';
import {Provider} from 'react-redux';
import store from './store';
import {
  HashRouter as Router,
  Switch,
  Route
} from 'react-router-dom';
import Routers from './router/Routers';
import Login from './pages/login/Login';
import 'antd/dist/antd.css';
import './initializeCss/initializeCss.css';

// 汉化开始
import {LocaleProvider} from 'antd';
import zh_CN from 'antd/es/locale-provider/zh_CN';
import moment from 'moment';
import 'moment/locale/zh-cn';

moment.locale('zh-cn');

render(
  <LocaleProvider locale={zh_CN}>
    <Provider store={store}>
      <Router>
        <Switch>
          <Route path='/login' exact component={Login}></Route>
          <Route path='/' component={Routers}></Route>
        </Switch>
      </Router>
    </Provider>
  </LocaleProvider>,
  window.root
);
